package com.sunstar.registered.hosp.controller;

import com.sunstar.registered.common.result.Result;
import com.sunstar.registered.hosp.service.HospitalService;
import com.sunstar.registered.model.hosp.Hospital;
import com.sunstar.registered.vo.hosp.HospitalQueryVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/admin/hosp/hospital")
@CrossOrigin
public class HospitalController {

    @Autowired
    private HospitalService hospitalService;

    //医院列表（条件查询带分页）
    @GetMapping("/{page}/limit")
    public Result listHosp(@PathVariable Integer page, @PathVariable Integer limit, HospitalQueryVo hospitalQueryVo) {
        Page<Hospital> pageModel = hospitalService.selectHospPage(page, limit, hospitalQueryVo);
        return Result.ok(pageModel);
    }

}
